<?php
    session_start();
    if($_SESSION['uid']==""||$_SESSION['level']!=2){
		exit();
	}
    include('/tool/PHPExcelOperation.php');
    include('/tool/submitValidate.php');
	include('/tool/pdo.php');
	include('/class/public-data.class.php');
	include('/bll/PublicDataBLL.php');
    include('/class/student-dormitory-list.class.php');
    include('/bll/StudentDormitoryListBLL.php');
    
    $action = isset($_GET['action']) ? $_GET['action'] : 1;
    $data = isset($_GET['data']) ? $_GET['data'] : '';

    switch((int)$action){
        //导出excel
        case 1:
            $excelInfo=json_decode($data);
            if($excelInfo!=null){
                $StudentDormitoryListBLL=new StudentDormitoryListBLL();
                $result=$StudentDormitoryListBLL->exportExcel($_SESSION['uid'],$excelInfo);
            }
        break;
        case 2:break;
        default:break;
    }

    //echo json_encode($result,JSON_UNESCAPED_UNICODE);
?>